# Maintainer: Frederic Wang <fred.wang@free.fr>

_realname=enum34
pkgbase=mingw-w64-python2-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=1.1.6
pkgrel=1
pkgdesc='Python 3.4 Enum backported (mingw-w64)'
arch=('any')
url='https://pypi.python.org/pypi/enum34'
license=('BSD')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2")
_dtoken="bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876"
source=("https://pypi.python.org/packages/${_dtoken}/${_realname}-${pkgver}.tar.gz")
sha256sums=('8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1')

prepare() {
  cd "${srcdir}"
  cp -r ${_realname}-${pkgver} python2-build
}

package() {
  depends=("${MINGW_PACKAGE_PREFIX}-python2")

  cd ${srcdir}/python2-build
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
    --root="${pkgdir}" --optimize=1

  install -Dm644 enum/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"
}
